*Replication file 00_Summary_Statistics
*Article: Counterfactual Coercion: Could harsher sanctions against Russia have prevented the worst?
*Authors: Thies Niemeier, Gerald Schneider

log using Log_files/00_Summary_Statistics
***************************************************************
***EU***
***************************************************************

*Prepare data
use "Dataset.dta", clear
keep if sender=="EU"

* Independent variables
gen ln_oil_gas_value_2014 = ln(oil_gas_value_2014+1)
gen sender_colony=0
replace sender_colony=1 if ht_colonial==2 | ht_colonial==3 | ht_colonial==6 | ht_colonial==7 | ht_colonial==8 | ht_colonial==9 | ht_colonial==10

gen sender_additional=cond(threatUS==1 | impositionUS == 1, 1, 0)
gen only_threat=cond(threatEU==1 & impositionEU == 0, 1, 0)

gen sender_trade = ln_EU_Trade_Eurostat
gen coup_dummy = coup1
replace coup_dummy = 0 if coup_dummy == 1
replace coup_dummy = 1 if coup_dummy == 2

* Dependent variable : 1 if a threat or sanction case was ongoing in the dyad
gen sanction_threat = sanction_dyad
replace sanction_threat = 1 if threat_dyad==1
tab sanction_threat
gen sanction_train= sanction_threat if year < 2009
gen sanction_test= sanction_threat if year >= 2009

* Dependent variable 2: 1 if a threat or sanction case started in the dyad
xtset ccodecow year
replace caseid=0 if caseid==.
gen sanctiononset = (caseid-l.caseid)
replace sanctiononset=1 if sanctiononset > 1 & !missing(sanctiononset)
replace sanctiononset=0 if sanctiononset < 0
replace sanctiononset=. if sanctiononset == 0 & (sanction_dyad == 1 | threat_dyad == 1)

* Summary statistics
tabstat sanction_threat sanctiononset pot_sanctioned_countries v2x_polyarchy gd_ptss coup_dummy one_sided_violence conflict mid_terr_integrity ln_GDPpc_imputed sender_trade sender_colony ln_oil_gas_value_2014 defense_alliance, statistics(count mean sd min max) format(%3.2f) save

matrix summ = r(StatTotal)

matrix summ = summ'

putdocx clear

putdocx begin

putdocx table summarize = matrix(summ), rownames colnames nformat(%9.2f) 

putdocx table summarize(1,1) = ("Variable")

putdocx table summarize(1,2) = ("Obs")

putdocx table summarize(1,4) = ("Std. Dev.")

putdocx table summarize(1,.), bold 

putdocx save Supplemental_Material/Summary_Statistics/Imposition_EU, replace

***************************************************************
***US***
***************************************************************

*Prepare data
use "Dataset.dta", clear
keep if sender=="US"

gen ln_oil_gas_value_2014 = ln(oil_gas_value_2014+1)
gen sender_colony=US_colony

gen sender_additional=cond(threatEU==1 | impositionEU == 1, 1, 0)
gen only_threat=cond(threatUS==1 & impositionUS == 0, 1, 0)

gen sender_trade =  ln_US_Trade_COW
gen coup_dummy = coup1
replace coup_dummy = 0 if coup_dummy == 1
replace coup_dummy = 1 if coup_dummy == 2

* Dependent variable : 1 if a threat or sanction case was ongoing in the dyad
gen sanction_threat = sanction_dyad
replace sanction_threat = 1 if threat_dyad==1
tab sanction_threat
gen sanction_train= sanction_threat if year < 2009
gen sanction_test= sanction_threat if year >= 2009

* Dependent variable 2: 1 if a threat or sanction case started in the dyad
xtset ccodecow year
replace caseid=0 if caseid==.
gen sanctiononset = (caseid-l.caseid)
replace sanctiononset=1 if sanctiononset > 1 & !missing(sanctiononset)
replace sanctiononset=0 if sanctiononset < 0
replace sanctiononset=. if sanctiononset == 0 & (sanction_dyad == 1 | threat_dyad == 1)

* Summary statistics
tabstat sanction_threat sanctiononset pot_sanctioned_countries v2x_polyarchy gd_ptss coup_dummy one_sided_violence conflict mid_terr_integrity ln_GDPpc_imputed sender_trade sender_colony ln_oil_gas_value_2014 defense_alliance, statistics(count mean sd min max) format(%3.2f) save

matrix summ = r(StatTotal)

matrix summ = summ'

putdocx clear

putdocx begin

putdocx table summarize = matrix(summ), rownames colnames nformat(%9.2f)

putdocx table summarize(1,1) = ("Variable")

putdocx table summarize(1,2) = ("Obs")

putdocx table summarize(1,4) = ("Std. Dev.")

putdocx table summarize(1,.), bold

putdocx save Supplemental_Material/Summary_Statistics/Imposition_US, replace

***************************************************************
******************** Success EU *******************************
***************************************************************

*Prepare data
use"Dataset.dta", clear
keep if sender=="EU"

* Setup
** Filter for cases of importance
keep if pot_sanctioned_countries == 1
** Set Panel Structure
xtset ccodecow year

* Independent Variables
gen ln_oil_gas_value_2014 = ln(oil_gas_value_2014+1)
gen sender_colony=0
replace sender_colony=1 if ht_colonial==2 | ht_colonial==3 | ht_colonial==6 | ht_colonial==7 | ht_colonial==8 | ht_colonial==9 | ht_colonial==10

gen sender_additional=cond(threatUS==1 | impositionUS == 1, 1, 0)
gen only_threat=cond(threatEU==1 & impositionEU == 0, 1, 0)
gen sender_trade = ln_EU_Trade_Eurostat
gen coup_dummy = coup1
replace coup_dummy = 0 if coup_dummy == 1
replace coup_dummy = 1 if coup_dummy == 2

* Variable indicating sanction onset
replace caseid=0 if caseid==.
gen sanctiononset = (caseid-l.caseid)
replace sanctiononset=1 if sanctiononset > 1 & !missing(sanctiononset)
replace sanctiononset=0 if sanctiononset < 0
replace sanctiononset=. if sanctiononset == 0 & (sanction_dyad == 1 | threat_dyad == 1)

* include threat intensity into intensity measure
gen intensity = impositionEU_target
replace intensity=threatEU_target if missing(intensity)

* combine intensity 1-2 & 3-5, because almost no cases
*3-4,5
replace intensity=1 if intensity==1 | intensity==2 
replace intensity=2 if intensity==3 | intensity==4 
replace intensity=3 if intensity==5
replace intensity=4 if intensity==6

* Gradualism
gen gradualism = impositionEU_gradualism
replace gradualism=1 if missing(impositionEU_gradualism) & sanctiononset==1

* Ordinal success variable based on HSE score
* 6; 12
gen ordsuccess=0 if sanctiononset == 1
replace ordsuccess=1 if HSEscore == 6 | HSEscore == 9
replace ordsuccess=2 if HSEscore == 12 | HSEscore == 16

keep if !missing(sanctiononset) & !missing(ordsuccess)

* Summary statistics
tabstat ordsuccess intensity v2x_polyarchy gd_ptss coup_dummy one_sided_violence conflict mid_terr_integrity ln_GDPpc_imputed sender_trade ln_oil_gas_value_2014 sender_colony defense_alliance sender_additional only_threat gradualism, statistics(count mean sd min max) format(%3.2f) save

matrix summ = r(StatTotal)

matrix summ = summ'

putdocx clear

putdocx begin

putdocx table summarize = matrix(summ), rownames colnames nformat(%9.2f)

putdocx table summarize(1,1) = ("Variable")

putdocx table summarize(1,2) = ("Obs")

putdocx table summarize(1,4) = ("Std. Dev.")

putdocx table summarize(1,.), bold

putdocx save Supplemental_Material/Summary_Statistics/Success_EU, replace

***************************************************************
******************** Success US *******************************
***************************************************************

*Prepare data
use"Dataset.dta", clear
keep if sender=="US"

* Setup
** Filter for cases of importance
keep if pot_sanctioned_countries == 1
** Set Panel Structure
xtset ccodecow year

* Independent Variables
gen ln_oil_gas_value_2014 = ln(oil_gas_value_2014+1)
gen sender_colony=US_colony

gen sender_additional=cond(threatEU==1 | impositionEU == 1, 1, 0)
gen only_threat=cond(threatUS == 1 & impositionUS == 0, 1, 0)
gen sender_trade = ln_US_Trade_COW
gen coup_dummy = coup1
replace coup_dummy = 0 if coup_dummy == 1
replace coup_dummy = 1 if coup_dummy == 2

* Variable indicating sanction onset
replace caseid=0 if caseid==.
gen sanctiononset = (caseid-l.caseid)
replace sanctiononset=1 if sanctiononset > 1 & !missing(sanctiononset)
replace sanctiononset=0 if sanctiononset < 0
replace sanctiononset=. if sanctiononset == 0 & (sanction_dyad == 1 | threat_dyad == 1)

* include threat intensity into intensity measure
gen intensity = impositionUS_target
replace intensity=threatUS_target if missing(intensity)

* combine intensity 1-2 & 3-5, because almost no cases
*3-4,5
replace intensity=1 if intensity==1 | intensity==2 
replace intensity=2 if intensity==3 | intensity==4 
replace intensity=3 if intensity==5
replace intensity=4 if intensity==6

* Gradualism
gen gradualism = impositionUS_gradualism
replace gradualism=1 if missing(impositionUS_gradualism) & sanctiononset==1

* Ordinal success variable based on HSE score
* 6; 12
gen ordsuccess=0 if sanctiononset == 1
replace ordsuccess=1 if HSEscore == 6 | HSEscore == 9
replace ordsuccess=2 if HSEscore == 12 | HSEscore == 16

keep if !missing(sanctiononset) & !missing(ordsuccess)

* Summary statistics
tabstat ordsuccess intensity v2x_polyarchy gd_ptss coup_dummy one_sided_violence conflict mid_terr_integrity ln_GDPpc_imputed sender_trade ln_oil_gas_value_2014 sender_colony defense_alliance sender_additional only_threat gradualism, statistics(count mean sd min max) format(%3.2f) save

matrix summ = r(StatTotal)

matrix summ = summ'

putdocx clear

putdocx begin

putdocx table summarize = matrix(summ), rownames colnames nformat(%9.2f)

putdocx table summarize(1,1) = ("Variable")

putdocx table summarize(1,2) = ("Obs")

putdocx table summarize(1,4) = ("Std. Dev.")

putdocx table summarize(1,.), bold

putdocx save Supplemental_Material/Summary_Statistics/Success_US, replace

log close